import request from "@/utils/request";

// 办件所属事项信息查询
export function getServiceInfo(serviceOid) {
  return request({
    url:
      process.env.VUE_APP_SX_ROUTE_PATH +
      "/affair/sxService/viewSxService?serviceOid=" +
      serviceOid,
    method: "get"
  });
}
// 办件信息查询
export function getOneCase(caseOid) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH +
      "/zcbl/case/queryTbCaseByCaseOid?caseOid=" +
      caseOid +
      "&sourceFlag=1",
    method: "get"
  });
}

// 办件信息查询
export function queryTbCaseByCase(caseOid) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH +
      "/zcbl/case/queryTbCaseByCase?caseOid=" +
      caseOid,
    method: "get"
  });
}

// 办件申请人信息查询
export function getOneApplyPerson(caseOid) {
  return request({
    url:
      process.env.VUE_APP_BJFW_ROUTE_PATH +
      "/qlCaseApplayService/queryQlCaseApplayByCaseOid?caseOid=" +
      caseOid,
    method: "get"
  });
}
// 办件环节信息查询
export function getOneLinkInfo(caseOid) {
  return request({
    url:
      process.env.VUE_APP_BJFW_ROUTE_PATH +
      "/qlCaseLinkResultService/queryQlCaseLinkResultListByCaseOid?caseOid=" +
      caseOid,
    method: "get"
  });
}
//送达方式
export function getQlCaseExt(caseOid) {
  return request({
    url:
      process.env.VUE_APP_BJFW_ROUTE_PATH +
      "/qlCaseExtService/queryQlCaseExtByCaseOid?caseOid=" +
      caseOid,
    method: "get"
  });
}

// 获取单个数字字典信息
export function getOneDict(oid) {
  return request({
    url: "/settings/security/dict/getSysDictByDictOid/" + oid,
    method: "get"
  });
}

// 获取出库信息
export function getOneByCaseNumber(caseNumber) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH +
      "/caseMaterialOut/getOneByCaseNumber?caseNumber=" +
      caseNumber,
    method: "post"
  });
}

// 获取单个数字字典信息
export function getCaseForm(caseOid) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH +
      "/caseForm/caseFormByCase?caseOid=" +
      caseOid,
    method: "get"
  });
}

// 获取办件caseOid
export function queryCaseOid(caseOid) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH +
      `/zcbl/case/queryCaseOid/${caseOid}`,
    method: "post"
  });
}

/**
 * 查询办件表单数据
 * @param {*} caseOid
 * @returns
 */
export function viewCaseFormByCaseOid(caseOid) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH +
      `/caseForm/viewCaseFormByCaseOid/${caseOid}`,
    method: "post"
  });
}
